function Apple (type) {
    this.type = type;
    this.color = "red";
}
 

var a1 = new Apple('a1')

// `console.log(a1.getInfo())

Apple.prototype.getInfo = function() {
    return this.color + ' ' + this.type + ' apple';
};


var a2 = new Apple('a2')

console.log(a1.getInfo())